<template>
  <avue-crud :data="data"
             :option="option"
             ref="crud">
    <template #menu="{row,index,size}">
      <el-button type="danger"
                 :size="size"
                 icon="el-icon-edit"
                 @click="$refs.crud.rowEdit(row,index)">编辑</el-button>
      <el-button type="success"
                 :size="size"
                 icon="el-icon-delete"
                 @click="$refs.crud.rowDel(row,index)">删除</el-button>
    </template>
  </avue-crud>
</template>

<script>
export default {
  data () {
    return {
      data: [
        {
          name: '张三',
          sex: '男'
        }, {
          name: '李四',
          sex: '女'
        }
      ],
      option: {
        delBtn: false,
        editBtn: false,
        column: [
          {
            label: '姓名',
            prop: 'name'
          }, {
            label: '性别',
            prop: 'sex'
          }
        ]
      },
    };
  }
}
</script>